function ajax(type,url,data){
    let xhr = new XMLHttpRequest();
    xhr.open(type,url,true);
    xhr.send(data);
    xhr.onreadystatechange = function(){
        if(xhr.readyState == 4 && xhr.status == 200){
            console.log(xhr.responseText);
        }
    }
}


//参数冗余
ajax('post','http://127.0.0.1:3000/api/getlunbo','name=awei');
ajax('post','http://127.0.0.1:3000/api/getlunbo','name=awei');
ajax('post','http://127.0.0.1:3000/api/getlunbo','name=awei');

// 颗粒化
let ajaxCurry = curry(ajax);
let post = ajaxCurry('POST');
post('http://127.0.0.1:3000/api/getlunbo','name=awei');